﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace hse_2013_project
{
    public class Food
    {
        private int x, y, width, height;
        private SolidBrush brush;
        public Rectangle foodRec;
        /// <summary>
        /// Конструктор класса
        /// </summary>
        /// <param name="randFood"></param>
        ///
        
        public Food(Random randFood)
        {
            x = randFood.Next(0, 36)*10;
            y = randFood.Next(2, 31)*10+4;
            brush = new SolidBrush(Color.White);
            width = 10;
            height = 10;
            foodRec = new Rectangle(x, y, width, height);
        }
        /// <summary>
        /// Расположение пищи
        /// </summary>
        /// <param name="randFood"></param>
        public void Location(Random randFood)
        {
            x = randFood.Next(0, 36) * 10;
            y = randFood.Next(2, 31) * 10 + 4;

        }

        /// <summary>
        /// Отрисовка пищи на экране
        /// </summary>
        /// <param name="e"></param>
        public void DrawFood(Graphics e)
        {
            foodRec.X = x;
            foodRec.Y = y;
            e.FillRectangle(brush, foodRec);
        }

    }
}
